package com.yanshaohui.feign;

import com.yanshaohui.bean.Person;
import com.yanshaohui.feign.fallback.ProviderBootFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Arrays;
import java.util.List;

/**
 * Created by TS-Ysh on 2018-05-16.
 */
@FeignClient(value="PROVIDER1",fallback = ProviderBootFallback.class)
public interface ProviderBoot {

    @GetMapping("/person/{id}")
    public Person getOnePerson(@PathVariable("id") Long id);

    @GetMapping("/persons")
    public List<Person> getAllPerson();

    @GetMapping("/person2/{id}")
    public Person getOnePerson2(@PathVariable("id") Long id);
}
